//定时任务
import db from '../utils/dbconf';
import { scheduleJob } from 'node-schedule';
import authserive from '../service/auth/relaction';
import { dateFormat } from '../utils/functions';
export const CORN_LOG_NAME = 'CORN_LOG';
export const pass_one_day = () => {
	scheduleJob('0 0 0 * * *', async () => {
		const starttime = dateFormat('YYYY/MM/DD hh:mm:ss', new Date());
		const info = await authserive.dailytask();
		db.table(CORN_LOG_NAME).add({ starttime, info: JSON.stringify(info) });
	});
};
